package com.example.demo.shengcheng;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Description {
    static Random random = new Random();
    static String[] strings={
            "挑拨离间，诽谤害人，油嘴滑舌，巧言相辩，说谎骗人",
            "若唆使她再嫁",
            "离间骨肉，挑唆父子，兄弟，姐妹夫妻不和之人",
            // 如果是坏人直接打入第四层
            "平日里家长里短，以讹传讹，陷害，诽谤、辱骂",
            "故意纵火或为毁灭罪证，报复，放火害命者",
            "杀生之孽",
            "凡谋害亲夫亲妻，与人通奸，恶意堕胎的恶夫恶妻",
            "卖淫嫖娼，盗贼抢劫，欺善凌弱，诬告诽谤他人，吃动物肉者，谋占他人财产，妻室之人",
            "随意虐待牲畜，把你的快乐建立在它们的痛苦上",
            "将婴儿溺死，抛弃",
            "浪费粮食，糟踏五谷",
            "不尊敬他人，不孝敬父母，不正直，歪门邪道",
//            "自杀",
            "挖坟掘墓",
            "损公肥私，行贿受贿，偷鸡摸狗，抢劫钱财，放火",
            "糟踏五谷，贼人小偷，贪官污吏，欺压百姓之人死",
            "偷工减料，欺上瞒下，买卖不公"
    };
    static String[] xg={
            "阴险","巧舌如簧","令人发指","里外不一","睚眦必报","祸害生灵","猪狗不如","欺软怕硬","心理变态","毫无人性","浪费","不敬他人",
            "胆大妄为","贪婪","横行霸道","贪便宜"
    };
    static int[] haor={
            0,0,1,0,0,5,0,0,10,0,0,0,0,12,0
    };
    static int i1;


// 判读是否为好人，死因
    public static List descr(double v, String reason){
        ArrayList<Object> list = new ArrayList<>();
        StringBuilder a= new StringBuilder();
        if (reason.equals("自杀")) {
             a.append("自杀,");
        }
        if (v<=0.5){
            int i = random.nextInt(2);
            for (int j = 0; j < i; j++) {
                i1 = haor[ random.nextInt(haor.length)];
                list.add(i1);
                a.append(strings[i1]);
            }
            list.add(a);
            return list;
        }else {
            int i = random.nextInt(strings.length);
            for (int j = 0; j < i; j++) {
                int i2 = random.nextInt(strings.length);
                list.add(i2);
                String aa= strings[i2];
                a.append(aa);
            }
            list.add(a);
            return list;
        }
    }
    public static String characterinfo(List list){
        StringBuilder a = new StringBuilder();
        for (int i = 0; i < list.size()-1; i++) {
            a.append(xg[(int) list.get(i)]).append(",");
        }
        return a.toString();
    }

    public static void main(String[] args) {
        List descr = descr(0.7, "");
        String characterinfo = characterinfo(descr);
        System.out.println(descr.get(descr.size()-1));
        System.out.println(characterinfo);
    }
}
